<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    var arr = [
      '李新杭',
      '董阳光',
      '郑嘉豪',
      '刘金浩',
      '房雪',
      '杨淼',
      '牛喻谦',
      '侯豪迪',
      '宋军超',
      '姜宁毅',
      '刘兴亚',
      '何国锋',
      '王静允',
      '张慧琳',
    ]
    $ab = ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'b', 'b', 'b', 'b', 'b']
    //随机打乱数组
    function shuffle(arr) {
      for (var i = 0; i < arr.length; i++) {
        var randomIndex = Math.floor(Math.random() * arr.length)
        var temp = arr[i]
        arr[i] = arr[randomIndex]
        arr[randomIndex] = temp
      }
      return arr
    }
    $tmp = shuffle(arr)
    $tmp2 = shuffle($ab)
    $res = $tmp.map(function (v, i) {
      return { name: v, juanzi: $ab[i] }
    })
    console.log($res)
  </script>
</html>
